package com.kolon.business.mngr.login.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.kolon.framework.interfaces.SimpleController;

@Controller("com.kolon.business.mngr.login.controller.LogoutController")
public class LogoutController implements SimpleController {

	@RequestMapping(value="/business/mngr/login/logout.do")
	public ModelAndView controller(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// 세션 제거
		HttpSession httpSession = request.getSession();
		httpSession.invalidate();
		// 리턴
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.setViewName("redirect:/business/mngr/index.do");
		return modelAndView;
	}

}
